Use data driven testing #4 - #6
Merged
Merged
Conversation
Signed-off-by: Jono Yang <jyang@nexb.com>
This help separate more complex tests from the ones that can be entirely data-driven. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Test all attributes from contenttype.Type object by adding a new to_dict() function and enhancing the FileTypeTest with all these attributes. At test time, test all attributes but check only with startswith() for text attributes rather than full equality. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This was done by collecting the list of touched files (with a temp override of get_test_loc() ) then touch empty yaml files and regenerating the tests. Finally the yaml files have been hand reviewed for correctness. All tests with complex expectations have been kept as-is and not migrated to data-driven tests Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This move most tests to datadriven using the original
code pushed by @JonoYang